<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SetCapsLockState/SetNumLockState/SetScrollLockState</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>SetCapsLockState/SetNumLockState/SetScrollLockState</h1>

<p>Sets the state of the Capslock/NumLock/ScrollLock key. Can also force the key to stay on or off.</p>

<pre class="Syntax">SetCapsLockState [, State]
SetNumLockState [, State]
SetScrollLockState [, State]</pre>
<h3>Parameters</h3>
<dl>

  <dt>State</dt>
  <dd><p>If this parameter is omitted, the AlwaysOn/Off attribute of the key is removed (if present). Otherwise, specify one of the following words:</p>
      <p><strong>On</strong>: Turns on the key and removes the AlwaysOn/Off attribute of the key (if present).</p>
	  <p><strong>Off</strong>: Turns off the key and removes the AlwaysOn/Off attribute of the key (if present).</p>
      <p><strong>AlwaysOn</strong>: Forces the key to stay on permanently.</p>
      <p><strong>AlwaysOff</strong>: Forces the key to stay off permanently.</p></dd>

</dl>

<h3>Remarks</h3>
<p>A key can also be toggled to its opposite state via the <a href="Send.htm">Send</a> command; for example: <code>Send {Capslock}</code>.</p>
<p>Keeping a key <em>AlwaysOn</em> or <em>AlwaysOff</em> requires the <a href="_InstallKeybdHook.htm">keyboard hook</a>, which will be automatically installed in such cases.</p>
<h3>Related</h3>
<p><a href="SetStoreCapslockMode.htm">SetStoreCapslockMode</a>, <a href="GetKeyState.htm">GetKeyState</a></p>
<h3>Examples</h3>
<pre class="NoIndent">SetNumlockState, on
SetScrollLockState, AlwaysOff</pre>

</body>
</html>
